<template>
	<view class="count-info">
		<view class="count-value">
			<view>
				<text style="font-size: 40rpx; color: #FFFFFF;">¥</text>
				<text style="font-size: 100rpx; color: #FFFFFF;">{{money}}</text>
			</view>
			<view>
				<text style="font-size: 40rpx; color: #FFFFFF;">可用余额</text>
			</view>
			<tui-button style="width: 500rpx; margin-top: 50rpx;" type="white" shape="circle" 
			            @click="toDeposit()">充值</tui-button>
			
		</view>
		<view class="count-box">
			<tui-list-cell arrow size="40" @click="goto('count-detail')">
			<text class="cell-text">交易明细</text>
			</tui-list-cell>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				money: 0
			}
		},
		onShow(){
			console.log("count on show.");
			this.getMoney();
		},
		methods: {
			goto(value){
				uni.navigateTo({
					url: '/pages/my/my-service/count/count-detail'
				})
			},
			toDeposit(){
				uni.navigateTo({
					url:"/pages/my/my-service/count/deposit/deposit"
				})
				
			},
			getMoney(){
				console.log(uni.getStorageSync("card_info"));
				this.money = uni.getStorageSync("card_info").cardMoney;
				
			}
		}
	}
</script>

<style lang="scss">
	@import './count.css';
</style>
